package com.xiaobange.controller.system;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xiaobange.dto.GeneralPageParam;
import com.xiaobange.entity.Medicine;
import com.xiaobange.service.MedicineService;
import com.xiaobange.vo.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version 1.0
 * @Author 小班哥
 * @Date 2025/9/21 14:15
 * @Explain 药品控制器
 */

@RestController
@RequestMapping("/sys/medicine")
public class MedicineController {

    @Autowired
    private MedicineService medicineService;


    /**
     * 分页查询药品信息
     * @param generalPageParam 分页参数
     * @return 响应结果
     */
    @RequestMapping("/query")
    public ResultResponse<?> queryPage(@RequestBody GeneralPageParam generalPageParam) {
        Page<Medicine> medicinePage = medicineService.queryPage(generalPageParam);
        return ResultResponse.success(medicinePage);
    }





}
